--[1]此为示例，系统参数-数据库版本号配置为1 系统从版本号2开始执行，此实例不会执行
BEGIN
ALTER TABLE [dbo].[SQL_TEXT]
    ADD [TEST] varchar (255) NULL;
EXEC sp_addextendedproperty
         'MS_Description', N'TEST',
         'SCHEMA', N'dbo',
         'TABLE', N'SQL_TEXT',
         'COLUMN', N'TEST';
END
--[2]文件管理-文档添加字段业务id
BEGIN
ALTER TABLE [dbo].[WK_FILE]
    ADD [BUSINESS_ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS NULL
    EXEC sp_addextendedproperty
    'MS_Description', N'业务id',
    'SCHEMA', N'dbo',
    'TABLE', N'WK_FILE',
    'COLUMN', N'BUSINESS_ID'
END

--[3]手工抄录指标设置
BEGIN
CREATE TABLE [dbo].[QI_INDEX_FEEITEM_MANUAL]
(
    [
    ID] nvarchar
(
    36
) COLLATE Chinese_PRC_CI_AS NOT NULL,
    [FEE_CODE] nvarchar
(
    100
) COLLATE Chinese_PRC_CI_AS NULL,
    [ORG_ID] nvarchar
(
    36
) COLLATE Chinese_PRC_CI_AS NULL,
    [CREATOR] nvarchar
(
    50
) COLLATE Chinese_PRC_CI_AS NULL,
    [CREATE_TIME] datetime2
(
    7
) NULL,
    [EDITOR] nvarchar
(
    50
) COLLATE Chinese_PRC_CI_AS NULL,
    [EDIT_TIME] datetime2
(
    7
) NULL,
    [DEL_FLAG] decimal
(
    38
) NULL,
    CONSTRAINT [PK__QI_INDEX__3214EC272C1FCF66] PRIMARY KEY CLUSTERED
(
[
    ID]
)
    WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
    ON [PRIMARY]
    )
    ON [PRIMARY]


ALTER TABLE [dbo].[QI_INDEX_FEEITEM_MANUAL]
    SET (LOCK_ESCALATION = TABLE)
    EXEC sp_addextendedproperty
    'MS_Description', N'主键',
    'SCHEMA', N'dbo',
    'TABLE', N'QI_INDEX_FEEITEM_MANUAL',
    'COLUMN', N'ID'
    EXEC sp_addextendedproperty
    'MS_Description', N'项目code',
    'SCHEMA', N'dbo',
    'TABLE', N'QI_INDEX_FEEITEM_MANUAL',
    'COLUMN', N'FEE_CODE'
    EXEC sp_addextendedproperty
    'MS_Description', N'组织机构id',
    'SCHEMA', N'dbo',
    'TABLE', N'QI_INDEX_FEEITEM_MANUAL',
    'COLUMN', N'ORG_ID'
    EXEC sp_addextendedproperty
    'MS_Description', N'创建人',
    'SCHEMA', N'dbo',
    'TABLE', N'QI_INDEX_FEEITEM_MANUAL',
    'COLUMN', N'CREATOR'
    EXEC sp_addextendedproperty
    'MS_Description', N'创建时间',
    'SCHEMA', N'dbo',
    'TABLE', N'QI_INDEX_FEEITEM_MANUAL',
    'COLUMN', N'CREATE_TIME'
    EXEC sp_addextendedproperty
    'MS_Description', N'编辑人',
    'SCHEMA', N'dbo',
    'TABLE', N'QI_INDEX_FEEITEM_MANUAL',
    'COLUMN', N'EDITOR'
    EXEC sp_addextendedproperty
    'MS_Description', N'编辑时间',
    'SCHEMA', N'dbo',
    'TABLE', N'QI_INDEX_FEEITEM_MANUAL',
    'COLUMN', N'EDIT_TIME'
    EXEC sp_addextendedproperty
    'MS_Description', N'删除标志',
    'SCHEMA', N'dbo',
    'TABLE', N'QI_INDEX_FEEITEM_MANUAL',
    'COLUMN', N'DEL_FLAG'
    EXEC sp_addextendedproperty
    'MS_Description', N'手工抄录指标设置',
    'SCHEMA', N'dbo',
    'TABLE', N'QI_INDEX_FEEITEM_MANUAL'
END

--[4]手工抄录指标设置-增加项目归类,报告单元字段
BEGIN
ALTER TABLE [dbo].[QI_INDEX_FEEITEM_MANUAL]
    ADD [ITEM_CLASS] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL


ALTER TABLE [dbo].[QI_INDEX_FEEITEM_MANUAL]
    ADD [RPT_GROUP] varchar (50) COLLATE Chinese_PRC_CI_AS NULL
    EXEC sp_addextendedproperty
    'MS_Description', N'项目归类',
    'SCHEMA', N'dbo',
    'TABLE', N'QI_INDEX_FEEITEM_MANUAL',
    'COLUMN', N'ITEM_CLASS'
    EXEC sp_addextendedproperty
    'MS_Description', N'报告单元编码',
    'SCHEMA', N'dbo',
    'TABLE', N'QI_INDEX_FEEITEM_MANUAL',
    'COLUMN', N'RPT_GROUP'
END

--[5]手工抄录指标设置-删除项目归类字段
BEGIN
ALTER TABLE [dbo].[QI_INDEX_FEEITEM_MANUAL]
DROP
COLUMN [ITEM_CLASS]
END

--[6]文件管理-文件夹添加设备文件夹字段
BEGIN
ALTER TABLE [dbo].[WK_FOLDER]
    ADD [FILE_FOLDER] varchar (255) COLLATE Chinese_PRC_CI_AS NULL
    EXEC sp_addextendedproperty
    'MS_Description', N'设备文件夹',
    'SCHEMA', N'dbo',
    'TABLE', N'WK_FOLDER',
    'COLUMN', N'FILE_FOLDER'
END

--[7]药敏模板结果表更换名称
EXEC sp_rename 'BAC_DRUG_RESULT_TEMPDETAIL', 'BAC_ANT_TEMP_DETAIL';


--[8]抗生素输入模板明细-添加敏感、中介、中量敏感、耐药等字段
BEGIN
ALTER TABLE [dbo].[BAC_ANT_TEMP_DETAIL]
    ADD [R] decimal (19, 6) NULL
ALTER TABLE [dbo].[BAC_ANT_TEMP_DETAIL]
    ADD [I] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL
ALTER TABLE [dbo].[BAC_ANT_TEMP_DETAIL]
    ADD [SDD] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL
ALTER TABLE [dbo].[BAC_ANT_TEMP_DETAIL]
    ADD [S] decimal (19, 6) NULL
ALTER TABLE [dbo].[BAC_ANT_TEMP_DETAIL]
    ADD [ECOFF] decimal (19, 6) NULL
    EXEC sp_addextendedproperty
    'MS_Description', N'耐药',
    'SCHEMA', N'dbo',
    'TABLE', N'BAC_ANT_TEMP_DETAIL',
    'COLUMN', N'R'
    EXEC sp_addextendedproperty
    'MS_Description', N'中介',
    'SCHEMA', N'dbo',
    'TABLE', N'BAC_ANT_TEMP_DETAIL',
    'COLUMN', N'I'
    EXEC sp_addextendedproperty
    'MS_Description', N'剂量依赖型敏感',
    'SCHEMA', N'dbo',
    'TABLE', N'BAC_ANT_TEMP_DETAIL',
    'COLUMN', N'SDD'
    EXEC sp_addextendedproperty
    'MS_Description', N'敏感',
    'SCHEMA', N'dbo',
    'TABLE', N'BAC_ANT_TEMP_DETAIL',
    'COLUMN', N'S'
    EXEC sp_addextendedproperty
    'MS_Description', N'流行病学界值',
    'SCHEMA', N'dbo',
    'TABLE', N'BAC_ANT_TEMP_DETAIL',
    'COLUMN', N'ECOFF'
END

--[9]危急值上报-添加危急值类型字段(1检验 2细菌)
BEGIN
ALTER TABLE [dbo].[LAB_CRITICAL_REPORT]
    ADD [CRITICAL_TYPE] decimal (2) NULL
    EXEC sp_addextendedproperty
    'MS_Description', N'危急值类型:1检验 2细菌',
    'SCHEMA', N'dbo',
    'TABLE', N'LAB_CRITICAL_REPORT',
    'COLUMN', N'CRITICAL_TYPE'
END

--[10]微生物检验目的明细-添加检验目的ID字段
BEGIN
ALTER TABLE [dbo].[BAC_REQ_PURPOSE_DETAIL]
    ADD [PURPOSE_ID] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL
ALTER TABLE [dbo].[BAC_REQPURPOSE_VS_FEEITEM]
    ADD [PURPOSE_ID] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL
    EXEC sp_addextendedproperty
    'MS_Description', N'检验目的ID',
    'SCHEMA', N'dbo',
    'TABLE', N'BAC_REQ_PURPOSE_DETAIL',
    'COLUMN', N'PURPOSE_ID'
    EXEC sp_addextendedproperty
    'MS_Description', N'检验目的ID',
    'SCHEMA', N'dbo',
    'TABLE', N'BAC_REQPURPOSE_VS_FEEITEM',
    'COLUMN', N'PURPOSE_ID'
END

/*
*添加时间   2024-11-16 15:54
*添加人     褚
*需求      检验主界面选择 检验医师 审核医师时 要求只展示是审核人员   审核人员的用户 过滤掉那些病区的护士用户
*需求提出人  蔡林涛
*待升级医院项目：济宁市肿瘤医院、泰安市妇幼保健院
----------------------------------------升级脚本--------------------------------------------
ALTER TABLE SYS_USER ADD IS_TEST_DOCTOR DECIMAL(2,0);
GO
ALTER TABLE SYS_USER ADD IS_CHK_DOCTOR DECIMAL(2,0);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否检验医师' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYS_USER', @level2type=N'COLUMN',@level2name=N'IS_TEST_DOCTOR'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否审核医师' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SYS_USER', @level2type=N'COLUMN',@level2name=N'IS_CHK_DOCTOR'
GO

*/

/*
*添加时间   2024-11-22
*添加人     LM
*需求      项目维护文字结果增加：是否在报告隐藏 字段
BEGIN
ALTER TABLE [dbo].[LAB_TEXT_RESULT] ADD [IS_HIDE_RPT] decimal(2) DEFAULT 0 NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否在报告隐藏',
'SCHEMA', N'dbo',
'TABLE', N'LAB_TEXT_RESULT',
'COLUMN', N'IS_HIDE_RPT'
END
 */

/*
*添加时间   2024-11-27
*添加人     WH
*需求      细菌仪抗生素字典表和微生物添加对照的抗生素code和名称
BEGIN
ALTER TABLE [dbo].[BAC_INSTR_ANT_DICT] ADD [INPUT_ANT_CODE] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL

ALTER TABLE [dbo].[BAC_INSTR_ANT_DICT] ADD [INPUT_ANT_NA] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL

    EXEC sp_addextendedproperty
    'MS_Description', N'对照杭生素编号',
    'SCHEMA', N'dbo',
    'TABLE', N'BAC_INSTR_ANT_DICT',
    'COLUMN', N'INPUT_ANT_CODE'


    EXEC sp_addextendedproperty
    'MS_Description', N'对照抗生素名称',
    'SCHEMA', N'dbo',
    'TABLE', N'BAC_INSTR_ANT_DICT',
    'COLUMN', N'INPUT_ANT_NA'


    EXEC sp_rename '[dbo].[BAC_INSTR_ANT_DICT].[ANT_NO]', 'ANT_CODE', 'COLUMN'

ALTER TABLE [dbo].[BAC_INSTR_GERM_DICT] ADD [INPUT_GERM_NO] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL

ALTER TABLE [dbo].[BAC_INSTR_GERM_DICT] ADD [INPUT_GERM_NA] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL

EXEC sp_addextendedproperty
'MS_Description', N'对照细菌编号',
'SCHEMA', N'dbo',
'TABLE', N'BAC_INSTR_GERM_DICT',
'COLUMN', N'INPUT_GERM_NO'

EXEC sp_addextendedproperty
'MS_Description', N'对照细菌名称',
'SCHEMA', N'dbo',
'TABLE', N'BAC_INSTR_GERM_DICT',
'COLUMN', N'INPUT_GERM_NA'

END
 */
/*
*添加时间   2024-11-27
*添加人     LM
*需求      图文报告模板 模板项目中增加：展示栏位 字段
BEGIN

ALTER TABLE [dbo].[LAB_TEMPLATE_DETAIL] ADD [SHOW_ROW_COL] varchar(20) COLLATE Chinese_PRC_CI_AS DEFAULT 'auto_col' NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'展示栏位',
'SCHEMA', N'dbo',
'TABLE', N'LAB_TEMPLATE_DETAIL',
'COLUMN', N'SHOW_ROW_COL'


END
 */

/**

    ALTER TABLE [dbo].[LAB_TEMPLATE_DETAIL] ADD [TYPE_FLAG] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL
GO

ALTER TABLE [dbo].[LAB_TEMPLATE_DETAIL] ADD [TEXT_HEIGHT] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL
GO

ALTER TABLE [dbo].[LAB_TEMPLATE_DETAIL] ADD [IS_ASS_TEMPLATE] decimal(10)  NULL
GO

ALTER TABLE [dbo].[LAB_TEMPLATE_DETAIL] ADD [TYPE_CODE] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL
GO

ALTER TABLE [dbo].[LAB_TEMPLATE_DETAIL] ADD [DETAIL_GROUP] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL
GO

ALTER TABLE [dbo].[LAB_TEMPLATE_DETAIL] ADD [DETAIL_GROUP2] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL
GO

ALTER TABLE [dbo].[LAB_TEMPLATE_DETAIL] ADD [SEQ] decimal(10)  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'类型标志',
'SCHEMA', N'dbo',
'TABLE', N'LAB_TEMPLATE_DETAIL',
'COLUMN', N'TYPE_FLAG'
GO

EXEC sp_addextendedproperty
'MS_Description', N'输入框高度',
'SCHEMA', N'dbo',
'TABLE', N'LAB_TEMPLATE_DETAIL',
'COLUMN', N'TEXT_HEIGHT'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否关联模版',
'SCHEMA', N'dbo',
'TABLE', N'LAB_TEMPLATE_DETAIL',
'COLUMN', N'IS_ASS_TEMPLATE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'分类对应编码',
'SCHEMA', N'dbo',
'TABLE', N'LAB_TEMPLATE_DETAIL',
'COLUMN', N'TYPE_CODE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'分组1',
'SCHEMA', N'dbo',
'TABLE', N'LAB_TEMPLATE_DETAIL',
'COLUMN', N'DETAIL_GROUP'
GO

EXEC sp_addextendedproperty
'MS_Description', N'分组2',
'SCHEMA', N'dbo',
'TABLE', N'LAB_TEMPLATE_DETAIL',
'COLUMN', N'DETAIL_GROUP2'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否关联模版',
'SCHEMA', N'dbo',
'TABLE', N'LAB_TEMPLATE_DETAIL',
'COLUMN', N'SEQ'



update LAB_TEMPLATE_DETAIL set SEQ = TRY_CAST(seq1 AS numeric(5, 0))

ALTER TABLE [dbo].[LAB_TEMPLATE_DETAIL] DROP COLUMN [SEQ1]

 */

/*
*添加时间   2024-11-28 11:37
*添加人     褚
*需求      检验主界面危急值上报 修改结果后重新上报
*需求提出人  游强
*待升级医院项目：济宁市肿瘤医院、泰安市妇幼保健院、山亭人民医院、济南银丰医院、天津北辰区域lis
----------------------------------------升级脚本--------------------------------------------
ALTER TABLE LAB_CRITICAL_REPORT ADD CURRENT_RESULT NVARCHAR(255);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'上报时当前结果' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LAB_CRITICAL_REPORT', @level2type=N'COLUMN',@level2name=N'CURRENT_RESULT'
GO
--达梦数据库需要执行
COMMENT ON COLUMN dbo.LAB_CRITICAL_REPORT.CURRENT_RESULT IS '上报时当前结果';
 */

/**
 *添加时间   2024-11-30 13:56
*添加人     褚
*需求      微生物检验节点添加报告单元、检验日期、样本编号
*需求提出人  彭荣帅
*待升级医院项目：济宁市肿瘤医院、泰安市妇幼保健院、山亭人民医院、济南银丰医院、天津北辰区域lis，伊通，机关医院
----------------------------------------升级脚本--------------------------------------------
ALTER TABLE BAC_TEST_FLOW_NODE ADD RPT_GROUP NVARCHAR(50);
GO
ALTER TABLE BAC_TEST_FLOW_NODE ADD SAMPLEDA DATETIME2(7);
GO
ALTER TABLE BAC_TEST_FLOW_NODE ADD SAMPLE_NO NVARCHAR(50);
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'报告单元' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_TEST_FLOW_NODE', @level2type=N'COLUMN',@level2name=N'RPT_GROUP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'检验日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_TEST_FLOW_NODE', @level2type=N'COLUMN',@level2name=N'SAMPLEDA'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标本号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_TEST_FLOW_NODE', @level2type=N'COLUMN',@level2name=N'SAMPLE_NO'
GO
  */


/**

ALTER TABLE [dbo].[LAB_REQ_MAIN] ADD [IS_SETTLE] decimal(2)  NULL
GO

ALTER TABLE [dbo].[LAB_REQ_MAIN] ADD [IS_STORE] decimal(2)  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否财务结算',
'SCHEMA', N'dbo',
'TABLE', N'LAB_REQ_MAIN',
'COLUMN', N'IS_SETTLE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否入库',
'SCHEMA', N'dbo',
'TABLE', N'LAB_REQ_MAIN',
'COLUMN', N'IS_STORE'

 */

/*

ALTER TABLE [dbo].[BAC_ANT_DICT] ADD [INFECT_SITE_NO] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL
GO

ALTER TABLE [dbo].[BAC_ANT_DICT] ADD [INFECT_SITE_NA] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL
GO

ALTER TABLE [dbo].[BAC_ANT_DICT] ADD [WHONET_TEST] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'感染部位编号',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ANT_DICT',
'COLUMN', N'INFECT_SITE_NO'
GO

EXEC sp_addextendedproperty
'MS_Description', N'感染部位名称',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ANT_DICT',
'COLUMN', N'INFECT_SITE_NA'
GO

EXEC sp_addextendedproperty
'MS_Description', N'WHONET检测',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ANT_DICT',
'COLUMN', N'WHONET_TEST'
 */

/*


update LAB_TEMPLATE_DETAIL set SEQ = TRY_CAST(seq1 AS numeric(5, 0))
 */


/*
*添加时间   2024-11-16 15:54
*添加人     褚
*需求      分管类别 添加采集量
*需求提出人  赵景领
*待升级医院项目：机关医院、银丰医院、伊通、北辰、济宁肿瘤、青岛优抚、山亭人民医院、泰安妇幼
----------------------------------------升级脚本--------------------------------------------
ALTER TABLE LAB_BARCODE_TYPE ADD COLLECT_QTY NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采集量' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LAB_BARCODE_TYPE', @level2type=N'COLUMN',@level2name=N'COLLECT_QTY'
GO

*/

/**
 *添加时间   2024-12-07 14:18
*添加人     LM
*需求      微生物检验包含预览若有图片则使用含图片的报告模板
*需求提出人  项目上线需求
*待升级医院项目：*
----------------------------------------升级脚本--------------------------------------------
alter table PUB_REPORT
	add INCLUDE_IMAGES varchar(6) default 0
go

exec sp_addextendedproperty 'MS_Description', '是否包含图片 0不包含，1包含', 'SCHEMA', 'dbo', 'TABLE', 'PUB_REPORT', 'COLUMN', 'INCLUDE_IMAGES'
go

  */

/**
 *添加时间   2024-12-09 19:25
*添加人     LM
*需求      实现系统配置字体大小和加粗功能
*需求提出人  项目上线需求
*待升级医院项目：*
----------------------------------------升级脚本--------------------------------------------

ALTER TABLE [dbo].[WL_CONFIG] ADD [FONT_SIZE] varchar(20) COLLATE Chinese_PRC_CI_AS DEFAULT 'small' NULL
GO

ALTER TABLE [dbo].[WL_CONFIG] ADD [FONT_WEIGHT] decimal(2) DEFAULT 0 NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'字体大小',
'SCHEMA', N'dbo',
'TABLE', N'WL_CONFIG',
'COLUMN', N'FONT_SIZE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'字体加粗（0：否，1：是）',
'SCHEMA', N'dbo',
'TABLE', N'WL_CONFIG',
'COLUMN', N'FONT_WEIGHT'

  */


/**
 *添加时间   2024-12-10 9:25
*添加人     LM
*需求      优化实现系统配置字体大小和加粗功能，本次修改实现宽泛调整加粗范围
*需求提出人  项目上线需求
*待升级医院项目：*
----------------------------------------升级脚本--------------------------------------------

alter table WL_CONFIG drop constraint DF__WL_CONFIG__FONT___00B50445
go

alter table WL_CONFIG alter column FONT_WEIGHT varchar(10) null
go

alter table WL_CONFIG add default '400' for FONT_WEIGHT
go
exec sp_updateextendedproperty 'MS_Description', '字体加粗（从100到900）', 'SCHEMA', 'dbo', 'TABLE', 'WL_CONFIG', 'COLUMN', 'FONT_WEIGHT'
go

  */


/*
*添加时间   2024-12-10 17:00
*添加人     褚
*需求      危急值 高危  低危 颜色字段的设置
*需求提出人  赵景领
*待升级医院项目：机关医院、银丰医院、伊通、北辰、济宁肿瘤、青岛优抚、山亭人民医院、泰安妇幼
----------------------------------------升级脚本--------------------------------------------
ALTER TABLE LAB_ITEM_DICT_CRITICAL ADD LOW_TEXT NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'低危显示标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LAB_ITEM_DICT_CRITICAL', @level2type=N'COLUMN',@level2name=N'LOW_TEXT'
GO
ALTER TABLE LAB_ITEM_DICT_CRITICAL ADD UP_TEXT NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'高危显示标志' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LAB_ITEM_DICT_CRITICAL', @level2type=N'COLUMN',@level2name=N'UP_TEXT'
GO
ALTER TABLE LAB_ITEM_DICT_CRITICAL ADD CATCH_COLOR NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'异常颜色' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LAB_ITEM_DICT_CRITICAL', @level2type=N'COLUMN',@level2name=N'CATCH_COLOR'
GO
ALTER TABLE LAB_ITEM_DICT_CRITICAL ADD COLOR_FOR NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'颜色值影响背景色还是文字颜色   0 /null不起作用走系统默认   1 背景颜色  2 文字颜色' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LAB_ITEM_DICT_CRITICAL', @level2type=N'COLUMN',@level2name=N'COLOR_FOR'
GO

ALTER TABLE [dbo].[LAB_ITEM_DICT_CRITICAL] ADD [LOW_CATCH_COLOR] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'低危异常颜色',
'SCHEMA', N'dbo',
'TABLE', N'LAB_ITEM_DICT_CRITICAL',
'COLUMN', N'LOW_CATCH_COLOR'
GO



ALTER TABLE LAB_RPTRESULT ADD ALARM_TYPE NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'危急值类型  1 低危    2  高危' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LAB_RPTRESULT', @level2type=N'COLUMN',@level2name=N'ALARM_TYPE'
GO
ALTER TABLE LAB_RPTRESULT ADD CATCH_COLOR NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'异常颜色' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LAB_RPTRESULT', @level2type=N'COLUMN',@level2name=N'CATCH_COLOR'
GO
ALTER TABLE LAB_RPTRESULT ADD COLOR_FOR NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'颜色值影响背景色还是文字颜色   0 /null 系统默认   1 背景颜色  2 文字颜色' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'LAB_RPTRESULT', @level2type=N'COLUMN',@level2name=N'COLOR_FOR'
GO

*/
/*
用户添加授权部门表 山亭已加

CREATE TABLE [dbo].[SYS_USER_DEPARTMENT] (
  [ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [USER_ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  [DEPT_ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  [DEPT_CODE] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATOR] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [EDITOR] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATE_TIME] datetime2(7)  NULL,
  [EDIT_TIME] datetime2(7)  NULL,
  [DEL_FLAG] decimal(2)  NULL,
  [ORG_ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  PRIMARY KEY CLUSTERED ([ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'SYS_USER_DEPARTMENT',
'COLUMN', N'ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'用户id',
'SCHEMA', N'dbo',
'TABLE', N'SYS_USER_DEPARTMENT',
'COLUMN', N'USER_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'部门ID',
'SCHEMA', N'dbo',
'TABLE', N'SYS_USER_DEPARTMENT',
'COLUMN', N'DEPT_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'部门code',
'SCHEMA', N'dbo',
'TABLE', N'SYS_USER_DEPARTMENT',
'COLUMN', N'DEPT_CODE'
GO

EXEC sp_addextendedproperty
'MS_Des'
 */

/*
/*
*添加时间   2024-12-17 12:17
*添加人     prs
*需求      质控项目定义
*需求提出人  蔡
*待升级医院项目：机关医院、银丰医院、伊通、北辰、青岛优抚、山亭人民医院、泰安妇幼


ALTER TABLE [dbo].[QC_INSTR_ITEM] ADD [ITEM_DEFINE] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目定义',
'SCHEMA', N'dbo',
'TABLE', N'QC_INSTR_ITEM',
'COLUMN', N'ITEM_DEFINE' ;


UPDATE QC_INSTR_ITEM set item_define = 'dl';


ALTER TABLE [dbo].[QC_MATERIAL_ITEM] ADD [ITEM_DEFINE] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目定义',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM',
'COLUMN', N'ITEM_DEFINE' ;


UPDATE QC_MATERIAL_ITEM set item_define = 'dl';


IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[QC_MATERIAL_ITEM_FIXED]') AND type IN ('U'))
	DROP TABLE [dbo].[QC_MATERIAL_ITEM_FIXED]
GO

CREATE TABLE [dbo].[QC_MATERIAL_ITEM_FIXED] (
  [ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [MATERIAL_ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  [MATERIAL_ITEM_ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  [QC_ITEM_ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  [INSTR_ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  [ITEM_DICT_ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  [ENABLE_DATE] datetime  NULL,
  [RESULT] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [NUM_RESULT] decimal(19,6)  NULL,
  [Z] decimal(19,6)  NULL,
  [IS_ALARM] decimal(38)  NULL,
  [IS_OUT_CONTROL] decimal(38)  NULL,
  [STOP_DATE] datetime  NULL,
  [STOP_OPERATOR] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ORG_ID] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [SEQ] decimal(11)  NULL,
  [DEL_FLAG] decimal(6)  NULL,
  [CREATOR] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATE_TIME] datetime2(7)  NULL,
  [EDITOR] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  [EDIT_TIME] datetime2(7)  NULL
)
GO

ALTER TABLE [dbo].[QC_MATERIAL_ITEM_FIXED] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'ID',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'质控品ID',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'MATERIAL_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'质控品项目ID',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'MATERIAL_ITEM_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'仪器质控项目ID',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'QC_ITEM_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'仪器ID',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'INSTR_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报告项目ID',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'ITEM_DICT_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'启用日期',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'ENABLE_DATE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'质控结果',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'RESULT'
GO

EXEC sp_addextendedproperty
'MS_Description', N'质控数值结果',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'NUM_RESULT'
GO

EXEC sp_addextendedproperty
'MS_Description', N'Z分数值',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'Z'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否警告1是0否',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'IS_ALARM'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否失控:1是失控0否',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'IS_OUT_CONTROL'
GO

EXEC sp_addextendedproperty
'MS_Description', N'停用日期',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'STOP_DATE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'停用操作者',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'STOP_OPERATOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'组织机构ID',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'ORG_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'顺序',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'SEQ'
GO

EXEC sp_addextendedproperty
'MS_Description', N'删除标记：1删除',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'DEL_FLAG'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'CREATOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'CREATE_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'EDITOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED',
'COLUMN', N'EDIT_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'质控定义结果设定',
'SCHEMA', N'dbo',
'TABLE', N'QC_MATERIAL_ITEM_FIXED'
GO


-- ----------------------------
-- Primary Key structure for table QC_MATERIAL_ITEM_FIXED
-- ----------------------------
ALTER TABLE [dbo].[QC_MATERIAL_ITEM_FIXED] ADD CONSTRAINT [PK__QC_MATER__3214EC2718427481] PRIMARY KEY CLUSTERED ([ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO


 */


/*
*添加时间   2024-12-17 12:17
*添加人     褚
*需求      培养瓶样式
*需求提出人  赵景领
*待升级医院项目：机关医院、银丰医院、伊通、北辰、济宁肿瘤、青岛优抚、山亭人民医院、泰安妇幼
----------------------------------------升级脚本--------------------------------------------
ALTER TABLE BAC_CUL_MEDIUM ADD MEDIUM_TYPE NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'培养基类型  1、培养基  2、培养瓶' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_CUL_MEDIUM', @level2type=N'COLUMN',@level2name=N'MEDIUM_TYPE'
GO
ALTER TABLE BAC_CUL_MEDIUM ADD MEDIUM_COLOR NVARCHAR(100);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'培养基颜色' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_CUL_MEDIUM', @level2type=N'COLUMN',@level2name=N'MEDIUM_COLOR'
GO
ALTER TABLE BAC_CUL_MEDIUM ADD MEDIUM_TAG NVARCHAR(100);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'培养基样式标签' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_CUL_MEDIUM', @level2type=N'COLUMN',@level2name=N'MEDIUM_TAG'
GO
 */



/**
 *添加时间   2024-12-17 16:25
*添加人     LM
*需求      微生物危急值上报
*需求提出人  项目上线需求
*待升级医院项目：*
----------------------------------------升级脚本--------------------------------------------


ALTER TABLE [dbo].[LAB_CRITICAL_REPORT] ADD [CULTICAL_ITEM_TYPE] decimal(2)  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'危急值项目类型:1血培养 2形态镜像 3敏鉴 4药敏',
'SCHEMA', N'dbo',
'TABLE', N'LAB_CRITICAL_REPORT',
'COLUMN', N'CULTICAL_ITEM_TYPE'

  */


/**
 *添加时间   2024-12-18 13:25
*添加人     whx
*需求      微生物界面调整
*需求提出人  项目上线需求
*待升级医院项目：*
----------------------------------------升级脚本--------------------------------------------
ALTER TABLE BAC_RPTRESULT ADD DRUG_ALARM_TEXT NVARCHAR(255);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'药敏危急值描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_RPTRESULT', @level2type=N'COLUMN',@level2name=N'DRUG_ALARM_TEXT'
GO

ALTER TABLE BAC_RPTRESULT ADD IS_DRUG_ALARM DECIMAL(2,0);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否药敏危急值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_RPTRESULT', @level2type=N'COLUMN',@level2name=N'IS_DRUG_ALARM'
GO

ALTER TABLE BAC_RPTRESULT ADD IS_CONTAGION DECIMAL(2,0);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否传染病' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_RPTRESULT', @level2type=N'COLUMN',@level2name=N'IS_CONTAGION'
GO

ALTER TABLE BAC_OBSER_RESULT ADD ALARM_TEXT NVARCHAR(500);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'形态危急值描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_OBSER_RESULT', @level2type=N'COLUMN',@level2name=N'ALARM_TEXT'
GO

ALTER TABLE BAC_OBSER_RESULT ADD IS_ALARM DECIMAL(2,0);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否形态危急值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_OBSER_RESULT', @level2type=N'COLUMN',@level2name=N'IS_ALARM'
GO

ALTER TABLE BAC_BLOOD_CULTRUE ADD DESTRUCTION_TIME DATETIME2(7);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'销毁时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BLOOD_CULTRUE', @level2type=N'COLUMN',@level2name=N'DESTRUCTION_TIME'
GO

ALTER TABLE BAC_BLOOD_CULTRUE ADD SAMPLING_SITE NVARCHAR(255);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'采样部位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BLOOD_CULTRUE', @level2type=N'COLUMN',@level2name=N'SAMPLING_SITE'
GO

ALTER TABLE BAC_BLOOD_CULTRUE ADD ALARM_TEXT NVARCHAR(255);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'血培养危急值描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BLOOD_CULTRUE', @level2type=N'COLUMN',@level2name=N'ALARM_TEXT'
GO
ALTER TABLE BAC_RPTRESULT ADD CUL_MEDIUM_NO NVARCHAR(255);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'培养基编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_RPTRESULT', @level2type=N'COLUMN',@level2name=N'CUL_MEDIUM_NO'
GO
 */
/**
 *添加时间   2024-12-19 13:25
*添加人     wh
*需求      报告项目通道号转译
*需求提出人  项目上线需求

/*

ALTER TABLE [dbo].[LAB_ITEM_DICT] ADD [IS_TRAN] nvarchar(2) COLLATE Chinese_PRC_CI_AS  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否转译 1是 0非',
'SCHEMA', N'dbo',
'TABLE', N'LAB_ITEM_DICT',
'COLUMN', N'IS_TRAN'
 */
/**


 *添加时间   2024-12-20 13:25
*添加人     prs
*需求      报告项目通道号转译
*需求提出人  项目上线需求


ALTER TABLE [dbo].[LAB_PROCESS_SET] ADD [DISPLAY_COLOR] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL
GO
EXEC sp_addextendedproperty
'MS_Description', N'显示颜色',
'SCHEMA', N'dbo',
'TABLE', N'LAB_PROCESS_SET',
'COLUMN', N'DISPLAY_COLOR'

 */
/**
    创建报告项目通道号转译对照表
 */
 */
    CREATE TABLE [dbo].[LAB_DICTITEM_VS_CHANNEL] (
  [ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [RPT_GROUP] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ITEM_NO] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [ITEM_NA] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [INSTR_CODE] varchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
  [INSTR_NAME] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CHANNEL_CODE] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  [FEE_CODE] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FEE_NAME] nvarchar(200) COLLATE Chinese_PRC_CI_AS  NULL,
  [TRAN_CHANNEL_CODE] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [ORG_ID] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATOR] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATE_TIME] datetime2(7)  NULL,
  [EDITOR] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [EDIT_TIME] datetime2(7)  NULL,
  [DEL_FLAG] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
  CONSTRAINT [PK__LAB_DICT__3214EC272C7A3779] PRIMARY KEY CLUSTERED ([ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
ON [PRIMARY]
GO

ALTER TABLE [dbo].[LAB_DICTITEM_VS_CHANNEL] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报告单元',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'RPT_GROUP'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目代码',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'ITEM_NO'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目名称',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'ITEM_NA'
GO

EXEC sp_addextendedproperty
'MS_Description', N'仪器代号',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'INSTR_CODE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'仪器名称',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'INSTR_NAME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'通道号',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'CHANNEL_CODE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目编码',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'FEE_CODE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目名称',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'FEE_NAME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'转译通道号',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'TRAN_CHANNEL_CODE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'组织机构id',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'ORG_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'CREATOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'CREATE_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编辑人',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'EDITOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编辑时间',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'EDIT_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'删除标志',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL',
'COLUMN', N'DEL_FLAG'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报告项目通道号转译对照',
'SCHEMA', N'dbo',
'TABLE', N'LAB_DICTITEM_VS_CHANNEL'

 */


/**


 *添加时间   2024-12-25 10:33
*添加人     cfz
*需求      微生物折点字典表
*需求提出人  项目上线需求
-----------------------------------------------------------------------------------------------------------------
CREATE TABLE [dbo].[BAC_BREAK_POINT](
	[ID] [nvarchar](50) NOT NULL,
	[GUIDELINES] [nvarchar](max) NULL,
	[YEAR] [int] NULL,
	[TEST_METHOD] [nvarchar](50) NULL,
	[POTENCY] [nvarchar](255) NULL,
	[ORGANISM_CODE] [nvarchar](255) NULL,
	[SEROVAR_GROUP] [nvarchar](255) NULL,
	[WHONET_ORG_CODE] [nvarchar](255) NULL,
	[SPECIES_GROUP] [nvarchar](255) NULL,
	[GENUS_CODE] [nvarchar](255) NULL,
	[FAMILY_CODE] [nvarchar](255) NULL,
	[ANAEROBE] [nvarchar](255) NULL,
	[SUBKINGDOM_CODE] [nvarchar](255) NULL,
	[BREAKPOINT_TYPE] [nvarchar](50) NULL,
	[HOST] [nvarchar](255) NULL,
	[SITE_OF_INFECTION] [nvarchar](1) NULL,
	[REFERENCE_TABLE] [nvarchar](1000) NULL,
	[WHONET_ABX_CODE] [nvarchar](1) NULL,
	[WHONET_TEST] [nvarchar](1) NULL,
	[R] [nvarchar](50) NULL,
	[I] [nvarchar](255) NULL,
	[SDD] [nvarchar](255) NULL,
	[S] [nvarchar](255) NULL,
	[ECV_ECOFF] [nvarchar](255) NULL,
	[ECV_ECOFF_TENTATIVE] [decimal](2, 0) NULL,
	[DATE_ENTERED] [datetime2](7) NULL,
	[DATE_MODIFIED] [datetime2](7) NULL,
	[COMMENTS] [nvarchar](2000) NULL,
	[ORG_ID] [nvarchar](36) NULL,
	[CREATOR] [nvarchar](36) NULL,
	[CREATE_TIME] [datetime2](7) NULL,
	[EDITOR] [nvarchar](36) NULL,
	[EDIT_TIME] [datetime2](7) NULL,
	[DEL_FLAG] [decimal](6, 0) NULL,
PRIMARY KEY CLUSTERED
(
	[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'指南名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'GUIDELINES'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'年份' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'YEAR'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'测试方法  DISK / MIC' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'TEST_METHOD'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'测试物质的效力相关' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'POTENCY'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'微生物代码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'ORGANISM_CODE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'血清型组' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'SEROVAR_GROUP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'WHONET微生物组织代码类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'WHONET_ORG_CODE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'物种组代码类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'SPECIES_GROUP'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'属组代码类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'GENUS_CODE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'科相关的代码类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'FAMILY_CODE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'厌氧菌代码类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'ANAEROBE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'结合ANAEROBE以及SUBKINGDOM_CODE进行判断' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'SUBKINGDOM_CODE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'折点的类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'BREAKPOINT_TYPE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'宿主信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'HOST'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述感染部位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'SITE_OF_INFECTION'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'参考表格相关的信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'REFERENCE_TABLE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'WHONET抗生素代码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'WHONET_ABX_CODE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'WHONET测试代码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'WHONET_TEST'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'耐药' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'R'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'中介' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'I'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'SDD' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'SDD'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'敏感' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'S'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'流行病学临界值' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'ECV_ECOFF'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ECV_ECOFF是否是暂定 0否 1是' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'ECV_ECOFF_TENTATIVE'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'折点信息的录入日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'DATE_ENTERED'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'折点信息的修改日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'DATE_MODIFIED'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'折点注释信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'COMMENTS'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'组织机构' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'ORG_ID'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'CREATOR'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'CREATE_TIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'EDITOR'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'修改时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'EDIT_TIME'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否删除：1是0否' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'DEL_FLAG'
GO





ALTER TABLE BAC_GERM_DICT ADD MORPHOLOGY NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'形态学' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_GERM_DICT', @level2type=N'COLUMN',@level2name=N'MORPHOLOGY'
GO
ALTER TABLE BAC_GERM_DICT ADD ORG_KINGDOM NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'界' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_GERM_DICT', @level2type=N'COLUMN',@level2name=N'ORG_KINGDOM'
GO
ALTER TABLE BAC_GERM_DICT ADD ORG_CLASS NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'纲' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_GERM_DICT', @level2type=N'COLUMN',@level2name=N'ORG_CLASS'
GO
ALTER TABLE BAC_GERM_DICT ADD ORG_ORDER NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'目' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_GERM_DICT', @level2type=N'COLUMN',@level2name=N'ORG_ORDER'
GO
ALTER TABLE BAC_GERM_DICT ADD SUBKINGDOM_CODE NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'结合ANAEROBE以及SUBKINGDOM_CODE进行判断' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_GERM_DICT', @level2type=N'COLUMN',@level2name=N'SUBKINGDOM_CODE'
GO
 */

/**
*添加时间   2024-12-26 15:14
*添加人     prs
*需求      微生物 是否阳性
*需求提出人  项目上线需求

ALTER TABLE [dbo].[BAC_BLOOD_CULTRUE] ADD [IS_POSITIVE] decimal(2)  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否阳性，1阳性，0阴性',
'SCHEMA', N'dbo',
'TABLE', N'BAC_BLOOD_CULTRUE',
'COLUMN', N'IS_POSITIVE'

 */


/**
 *添加时间   2024-12-25 10:33
*添加人     cfz
*需求      微生物折点字典表
*需求提出人  项目上线需求

ALTER TABLE BAC_BREAK_POINT ADD GENUS_GROUP NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'属分组' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'GENUS_GROUP'
GO


ALTER TABLE BAC_BREAK_POINT ADD REF NVARCHAR(255);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'参考范围' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_BREAK_POINT', @level2type=N'COLUMN',@level2name=N'REF'
GO

ALTER TABLE BAC_DRUG_RESULT ADD DATA_FROM NVARCHAR(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数据来源  1 仪器上传    2  手工添加  3 开始仪器上传 后来手工修改' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'BAC_DRUG_RESULT', @level2type=N'COLUMN',@level2name=N'DATA_FROM'
GO
 */


/**
*添加时间   2024-12-27 15:14
*添加人     whx
*需求      检验 标本合并
*需求提出人  项目上线需求


IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[LAB_MAPPER_ITEM]') AND type IN ('U'))
	DROP TABLE [dbo].[LAB_MAPPER_ITEM]
GO

CREATE TABLE [dbo].[LAB_MAPPER_ITEM] (
  [ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [RPT_GROUP] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [PID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  [CID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  [ITEM_NO] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [MAPPER_ITEM_CODE] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATOR] varchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATE_TIME] datetime2(7)  NULL,
  [EDITOR] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [EDIT_TIME] datetime2(7)  NULL,
  [DEL_FLAG] decimal(2)  NULL,
  [ORG_ID] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [ITEM_NA] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [MAPPER_ITEM_NAME] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL
)
GO

ALTER TABLE [dbo].[LAB_MAPPER_ITEM] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM',
'COLUMN', N'ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报告单元',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM',
'COLUMN', N'RPT_GROUP'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目ID',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM',
'COLUMN', N'PID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'对照项目ID',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM',
'COLUMN', N'CID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目代码',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM',
'COLUMN', N'ITEM_NO'
GO

EXEC sp_addextendedproperty
'MS_Description', N'对照项目',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM',
'COLUMN', N'MAPPER_ITEM_CODE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM',
'COLUMN', N'CREATOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM',
'COLUMN', N'CREATE_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编辑人 ',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM',
'COLUMN', N'EDITOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编辑时间',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM',
'COLUMN', N'EDIT_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'删除标志 0 否 1 是',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM',
'COLUMN', N'DEL_FLAG'
GO

EXEC sp_addextendedproperty
'MS_Description', N'组织机构id',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM',
'COLUMN', N'ORG_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目名称',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM',
'COLUMN', N'ITEM_NA'
GO

EXEC sp_addextendedproperty
'MS_Description', N'对照项目名称',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM',
'COLUMN', N'MAPPER_ITEM_NAME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'项目和项目之间的关联关系表(合并标本用)',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAPPER_ITEM'
GO

ALTER TABLE [dbo].[LAB_MAPPER_ITEM] ADD CONSTRAINT [PK__LAB_MAPP__3214EC27CD7F2116] PRIMARY KEY CLUSTERED ([ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO

 */


/**


 *添加时间   2024-12-29 15:09
*添加人     cfz
*需求      微生物药敏结果添加是否仪器上传 折点等字段
*需求提出人  项目上线需求
-------------------------------------------------------------------------------------------------------
ALTER TABLE [BAC_DRUG_RESULT] ADD IS_BP_FROM_INSTR decimal(2,0);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'折点是否来自仪器' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_DRUG_RESULT]', @level2type=N'COLUMN',@level2name=N'IS_BP_FROM_INSTR'
GO
ALTER TABLE [BAC_DRUG_RESULT] ADD SEROVAR_GROUP nvarchar(255);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'血清型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_DRUG_RESULT]', @level2type=N'COLUMN',@level2name=N'SEROVAR_GROUP'
GO
ALTER TABLE [BAC_DRUG_RESULT] ADD WHONET_ORG_CODE nvarchar(255);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'细菌代码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_DRUG_RESULT]', @level2type=N'COLUMN',@level2name=N'WHONET_ORG_CODE'
GO
ALTER TABLE [BAC_DRUG_RESULT] ADD SPECIES_GROUP nvarchar(255);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'种' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_DRUG_RESULT]', @level2type=N'COLUMN',@level2name=N'SPECIES_GROUP'
GO
ALTER TABLE [BAC_DRUG_RESULT] ADD GENUS_CODE nvarchar(255);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'属' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_DRUG_RESULT]', @level2type=N'COLUMN',@level2name=N'GENUS_CODE'
GO
ALTER TABLE [BAC_DRUG_RESULT] ADD GENUS_GROUP nvarchar(255);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'属分组' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_DRUG_RESULT]', @level2type=N'COLUMN',@level2name=N'GENUS_GROUP'
GO
ALTER TABLE [BAC_DRUG_RESULT] ADD FAMILY_CODE nvarchar(255);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'科' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_DRUG_RESULT]', @level2type=N'COLUMN',@level2name=N'FAMILY_CODE'
GO
ALTER TABLE [BAC_DRUG_RESULT] ADD ANAEROBE nvarchar(255);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'厌氧菌型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_DRUG_RESULT]', @level2type=N'COLUMN',@level2name=N'ANAEROBE'
GO
ALTER TABLE [BAC_DRUG_RESULT] ADD SUBKINGDOM_CODE nvarchar(255);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'亚界' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_DRUG_RESULT]', @level2type=N'COLUMN',@level2name=N'SUBKINGDOM_CODE'
GO
 */


/**
    *结果记录表添加 maininfoid
    *添加时间   2024-12-29 15:09

    ALTER TABLE [dbo].[LAB_RESULT_AMENDMENT] ADD [MAININFO_ID] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'检验主表信息id',
'SCHEMA', N'dbo',
'TABLE', N'LAB_RESULT_AMENDMENT',
'COLUMN', N'MAININFO_ID'

ALTER TABLE [dbo].[LAB_RESULT_AMENDMENT] ADD [ITEM_NO] varchar(500) COLLATE Chinese_PRC_CI_AS  NULL
GO

ALTER TABLE [dbo].[LAB_RESULT_AMENDMENT] ADD [ITEM_NA] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'报告项目代号',
'SCHEMA', N'dbo',
'TABLE', N'LAB_RESULT_AMENDMENT',
'COLUMN', N'ITEM_NO'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报告项目名称',
'SCHEMA', N'dbo',
'TABLE', N'LAB_RESULT_AMENDMENT',
'COLUMN', N'ITEM_NA'


ALTER TABLE [dbo].[LAB_MAIN_INFO_LOG] ADD [UPDATE_FIELD] nvarchar(30) COLLATE Chinese_PRC_CI_AS  NULL
GO

ALTER TABLE [dbo].[LAB_MAIN_INFO_LOG] ADD [ORIGINAL_RESULT] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL
GO

ALTER TABLE [dbo].[LAB_MAIN_INFO_LOG] ADD [AMENDED_RESULT] nvarchar(2000) COLLATE Chinese_PRC_CI_AS  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改字段',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAIN_INFO_LOG',
'COLUMN', N'UPDATE_FIELD'
GO

EXEC sp_addextendedproperty
'MS_Description', N'原始结果',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAIN_INFO_LOG',
'COLUMN', N'ORIGINAL_RESULT'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修订后结果',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAIN_INFO_LOG',
'COLUMN', N'AMENDED_RESULT'

ALTER TABLE [dbo].[LAB_MAIN_INFO_LOG] ADD [MAININFO_RESULT] varchar(1000) COLLATE Chinese_PRC_CI_AS  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'结果',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAIN_INFO_LOG',
'COLUMN', N'MAININFO_RESULT'
*/



/**
    仓库和冰箱中间表
    添加组织机构

ALTER TABLE [dbo].[SAMSTO_STORAGE_FRIDGE] ADD [ORG_ID] varchar(36) COLLATE Chinese_PRC_CI_AS  NULL
GO

ALTER TABLE [dbo].[SAMSTO_STORAGE_FRIDGE] ADD [CREATOR] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL
GO

ALTER TABLE [dbo].[SAMSTO_STORAGE_FRIDGE] ADD [CREATE_TIME] datetime2(7)  NULL
GO

ALTER TABLE [dbo].[SAMSTO_STORAGE_FRIDGE] ADD [EDITOR] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL
GO

ALTER TABLE [dbo].[SAMSTO_STORAGE_FRIDGE] ADD [EDIT_TIME] datetime2(7)  NULL
GO

ALTER TABLE [dbo].[SAMSTO_STORAGE_FRIDGE] ADD [DEL_FLAG] decimal(6)  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'组织机构主键',
'SCHEMA', N'dbo',
'TABLE', N'SAMSTO_STORAGE_FRIDGE',
'COLUMN', N'ORG_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人主键',
'SCHEMA', N'dbo',
'TABLE', N'SAMSTO_STORAGE_FRIDGE',
'COLUMN', N'CREATOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'SAMSTO_STORAGE_FRIDGE',
'COLUMN', N'CREATE_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编辑人主键',
'SCHEMA', N'dbo',
'TABLE', N'SAMSTO_STORAGE_FRIDGE',
'COLUMN', N'EDITOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编辑时间',
'SCHEMA', N'dbo',
'TABLE', N'SAMSTO_STORAGE_FRIDGE',
'COLUMN', N'EDIT_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否启用（0是1非）',
'SCHEMA', N'dbo',
'TABLE', N'SAMSTO_STORAGE_FRIDGE',
'COLUMN', N'DEL_FLAG'
     */

/*
文字结果
ALTER TABLE [dbo].[LAB_TEXT_RESULT] ALTER COLUMN [RESULT] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL
 */



/**
添加时间   2025-01-02 17:00
*添加人     cfz
*需求      微生物初级报告   二级报告  取消原因  时间  是否取消等字段
*需求提出人  项目上线需求
*-----------------------------------------------------------------------------------------
ALTER TABLE [BAC_PUBLIS_FIRST_REPORT] ADD IS_CANCEL decimal(2,0);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否取消' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_PUBLIS_FIRST_REPORT]', @level2type=N'COLUMN',@level2name=N'IS_CANCEL'
GO
ALTER TABLE [BAC_PUBLIS_FIRST_REPORT] ADD CANCEL_DATE datetime2(7);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'取消日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_PUBLIS_FIRST_REPORT]', @level2type=N'COLUMN',@level2name=N'CANCEL_DATE'
GO
ALTER TABLE [BAC_PUBLIS_FIRST_REPORT] ADD CANCEL_DOCTOR nvarchar(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'取医师' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_PUBLIS_FIRST_REPORT]', @level2type=N'COLUMN',@level2name=N'CANCEL_DOCTOR'
GO
ALTER TABLE [BAC_PUBLIS_FIRST_REPORT] ADD CANCEL_REASON nvarchar(100);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'取消原因 ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_PUBLIS_FIRST_REPORT]', @level2type=N'COLUMN',@level2name=N'CANCEL_REASON'
GO


ALTER TABLE [BAC_PUBLIS_SEC_REPORT] ADD IS_CANCEL decimal(2,0);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否取消' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_PUBLIS_SEC_REPORT]', @level2type=N'COLUMN',@level2name=N'IS_CANCEL'
GO
ALTER TABLE [BAC_PUBLIS_SEC_REPORT] ADD CANCEL_DATE datetime2(7);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'取消日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_PUBLIS_SEC_REPORT]', @level2type=N'COLUMN',@level2name=N'CANCEL_DATE'
GO
ALTER TABLE [BAC_PUBLIS_SEC_REPORT] ADD CANCEL_DOCTOR nvarchar(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'取医师' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_PUBLIS_SEC_REPORT]', @level2type=N'COLUMN',@level2name=N'CANCEL_DOCTOR'
GO
ALTER TABLE [BAC_PUBLIS_SEC_REPORT] ADD CANCEL_REASON nvarchar(100);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'取消原因 ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_PUBLIS_SEC_REPORT]', @level2type=N'COLUMN',@level2name=N'CANCEL_REASON'
GO
*/

/**
添加时间   2025-01-03 17:00
*添加人     wh
*需求      特殊规则用exist 添加中间表
*需求提出人  项目上线需求

 CREATE TABLE [dbo].[PUB_PEPORT_RULES_EXIST] (
  [ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [RULE_ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  [FIELD_CODE] varchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
  [FIELD_VALUE] varchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
  [ORG_ID] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATOR] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATE_TIME] datetime2(7)  NULL,
  [EDITOR] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [EDIT_TIME] datetime2(7)  NULL,
  [DEL_FLAG] decimal(6)  NULL,
  CONSTRAINT [PK__PUB_PEPO__3214EC270565AA26] PRIMARY KEY CLUSTERED ([ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
)
ON [PRIMARY]
GO

ALTER TABLE [dbo].[PUB_PEPORT_RULES_EXIST] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'PUB_PEPORT_RULES_EXIST',
'COLUMN', N'ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报告单规则id',
'SCHEMA', N'dbo',
'TABLE', N'PUB_PEPORT_RULES_EXIST',
'COLUMN', N'RULE_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'字段code',
'SCHEMA', N'dbo',
'TABLE', N'PUB_PEPORT_RULES_EXIST',
'COLUMN', N'FIELD_CODE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'值',
'SCHEMA', N'dbo',
'TABLE', N'PUB_PEPORT_RULES_EXIST',
'COLUMN', N'FIELD_VALUE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'组织机构ID',
'SCHEMA', N'dbo',
'TABLE', N'PUB_PEPORT_RULES_EXIST',
'COLUMN', N'ORG_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'PUB_PEPORT_RULES_EXIST',
'COLUMN', N'CREATOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'PUB_PEPORT_RULES_EXIST',
'COLUMN', N'CREATE_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编辑人',
'SCHEMA', N'dbo',
'TABLE', N'PUB_PEPORT_RULES_EXIST',
'COLUMN', N'EDITOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编辑时间',
'SCHEMA', N'dbo',
'TABLE', N'PUB_PEPORT_RULES_EXIST',
'COLUMN', N'EDIT_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'删除标志',
'SCHEMA', N'dbo',
'TABLE', N'PUB_PEPORT_RULES_EXIST',
'COLUMN', N'DEL_FLAG'
GO

EXEC sp_addextendedproperty
'MS_Description', N'特殊报告单规则exist查询',
'SCHEMA', N'dbo',
'TABLE', N'PUB_PEPORT_RULES_EXIST'
*/


/**


添加时间   2025-01-13 17:00
*添加人     prs
*需求      检验主表和结果表添加是否有值字段
*需求提出人  项目上线需求

ALTER TABLE [dbo].[LAB_RPTRESULT] ADD [IS_RESULT] decimal(2)  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否有值 1是0否',
'SCHEMA', N'dbo',
'TABLE', N'LAB_RPTRESULT',
'COLUMN', N'IS_RESULT'


ALTER TABLE [dbo].[LAB_MAININFO] ADD [IS_RESULT] decimal(2)  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否有值 1是0否',
'SCHEMA', N'dbo',
'TABLE', N'LAB_MAININFO',
'COLUMN', N'IS_RESULT'

INSERT INTO [dbo].[WL_CONFIG_FIELDSSETTING] ([ID], [WL_CONFIG_ID], [FIELD_CODE], [FIELD_NAME], [FIELD_DESCRIPTION], [DISPLAY_ORDER], [IS_VISIABLE], [COLUMN_WIDTH], [IS_FIX], [IS_SORTABLE], [ORG_ID], [CREATOR], [CREATE_TIME], [EDITOR], [EDIT_TIME], [DEL_FLAG], [ALIGN]) VALUES (N'1788814563257372675', N'1749352981304741890', N'isResult', N'完', N'完', N'1', 1, 16.00, 1, 0, N'1787488360349155329', N'1', '2024-05-10 14:13:21.0000000', N'1', '2025-01-09 09:51:15.0230000', 0.000000000000000000000000000000, N'center');

 */

/**
添加时间   2025-01-14 17:00
*添加人     whx
*需求      检验结果是否对照申请项目
*需求提出人  项目上线需求

INSERT INTO [dbo].[WL_CONFIG_RESULTSSETTING] ([ID], [WL_CONFIG_ID], [FIELD_CODE], [FIELD_NAME], [FIELD_DESCRIPTION], [DISPLAY_ORDER], [IS_VISIABLE], [COLUMN_WIDTH], [IS_FIX], [IS_SORTABLE], [ORG_ID], [CREATOR], [CREATE_TIME], [EDITOR], [EDIT_TIME], [DEL_FLAG], [ALIGN]) VALUES (N'1788601201470750723', N'1749352981304741890', N'isContrast', N'是否对照', N'是否对照', N'a00001', 1, 18.00, 1, 0, N'1787488360349155329', N'1', '2024-05-10 00:05:31.0000000', N'1', '2024-12-12 13:04:20.8740000', 0, N'center');

 */

/**
添加时间   2025-02-06
*添加人     whx
*需求      微生物新增多重耐药标志
*需求提出人  项目上线需求

INSERT INTO [dbo].[WL_CONFIG_FIELDSSETTING] ([ID], [WL_CONFIG_ID], [FIELD_CODE], [FIELD_NAME], [FIELD_DESCRIPTION], [DISPLAY_ORDER], [IS_VISIABLE], [COLUMN_WIDTH], [IS_FIX], [IS_SORTABLE], [ORG_ID], [CREATOR], [CREATE_TIME], [EDITOR], [EDIT_TIME], [DEL_FLAG], [ALIGN]) VALUES (N'1770347789276943554', N'1770343953300725762', N'isMdr', N'耐', N'耐', N'a00055', 1, 16.00, 1, 0, N'1787488360349155329', N'1', '2024-03-20 15:12:59.0000000', N'1795357900613804034', '2025-01-03 16:46:51.5130000', 0.000000000000000000000000000000, N'center');
 */

/**
添加时间   2025-02-11
*添加人     pc
*需求      微生物补费
*需求提出人  萌虎，老毛

CREATE TABLE [dbo].[BAC_ADD_FEE] (
  [ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [REQ_NO] varchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
  [FEE_CODE] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [FEE_NAME] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
  [AMOUNT] decimal(10,2)  NULL,
  [PRICE] decimal(10,2)  NULL,
  [COSTS] decimal(10,2)  NULL,
  [IS_CHARGE] decimal(2)  NULL,
  [ADD_USER] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [ADD_TIME] datetime2(7)  NULL,
  [SAMPLEDA] datetime2(7)  NULL,
  [RPT_GROUP] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [SAMPLE_NO] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [MESSAGE] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
  [REMARK1] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [REMARK2] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [REMARK3] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [REMARK4] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [ORG_ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATOR] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATE_TIME] datetime2(7)  NULL,
  [EDITOR] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [EDIT_TIME] datetime2(7)  NULL,
  [DEL_FLAG] decimal(2)  NULL
)
GO

ALTER TABLE [dbo].[BAC_ADD_FEE] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'条码号',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'REQ_NO'
GO

EXEC sp_addextendedproperty
'MS_Description', N'收费项目代号',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'FEE_CODE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'收费项目名称 一般是大项名称，肝功，肾功，血糖，生化全项',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'FEE_NAME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'AMOUNT'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单价',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'PRICE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'费用合计',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'COSTS'
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否计价 0是   1否',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'IS_CHARGE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'补录人',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'ADD_USER'
GO

EXEC sp_addextendedproperty
'MS_Description', N'补录时间',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'ADD_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'检验日期',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'SAMPLEDA'
GO

EXEC sp_addextendedproperty
'MS_Description', N'报告单元',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'RPT_GROUP'
GO

EXEC sp_addextendedproperty
'MS_Description', N'标本号',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'SAMPLE_NO'
GO

EXEC sp_addextendedproperty
'MS_Description', N'接口返回',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'MESSAGE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注1',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'REMARK1'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注2',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'REMARK2'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注3',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'REMARK3'
GO

EXEC sp_addextendedproperty
'MS_Description', N'备注4',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'REMARK4'
GO

EXEC sp_addextendedproperty
'MS_Description', N'组织机构ID',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'ORG_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'CREATOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'CREATE_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改人',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'EDITOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'修改时间',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'EDIT_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'删除标记',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE',
'COLUMN', N'DEL_FLAG'
GO

EXEC sp_addextendedproperty
'MS_Description', N'微生物补费表',
'SCHEMA', N'dbo',
'TABLE', N'BAC_ADD_FEE'
GO


-- ----------------------------
-- Primary Key structure for table BAC_ADD_FEE
-- ----------------------------
ALTER TABLE [dbo].[BAC_ADD_FEE] ADD CONSTRAINT [PK__BAC_ADD___3214EC274AD5FED4] PRIMARY KEY CLUSTERED ([ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO

INSERT INTO [dbo].[WL_CONFIG_FIELDSSETTING] ([ID], [WL_CONFIG_ID], [FIELD_CODE], [FIELD_NAME], [FIELD_DESCRIPTION], [DISPLAY_ORDER], [IS_VISIABLE], [COLUMN_WIDTH], [IS_FIX], [IS_SORTABLE], [ORG_ID], [CREATOR], [CREATE_TIME], [EDITOR], [EDIT_TIME], [DEL_FLAG], [ALIGN]) VALUES (N'1770347789276943666', N'1770343953300725762', N'addFee', N'费', N'费', N'a00055', 1, 16.00, 1, 0, N'1787488360349155329', N'1', '2024-03-20 15:12:59.0000000', N'1795357900613804034', '2025-01-03 16:46:51.5130000', 0.000000000000000000000000000000, N'center');
 */

/**
添加时间   2025-02-11
*添加人     cfz
*需求      微生物选用的培养基   添加自动编号字段
*需求提出人  老毛
ALTER TABLE [BAC_TEST_CUL_MEDIUM] ADD AUTO_NO nvarchar(50);
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'自动编号，微生物申请签收时自动生成的 培养基编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'[BAC_TEST_CUL_MEDIUM]', @level2type=N'COLUMN',@level2name=N'AUTO_NO'
GO
 */


/**

添加时间   2025-02-13
*添加人     prs
*需求      微生物 方案默认阴性结果结果选项
*需求提出人  老毛

CREATE TABLE [dbo].[BAC_FLOW_DEF_RESULT] (
  [ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [DEF_NO] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [DEF_NA] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [INPUT_CODE] nvarchar(500) COLLATE Chinese_PRC_CI_AS  NULL,
  [FLOW_NO] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [SEQ] decimal(6)  NULL,
  [ORG_ID] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATOR] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [CREATE_TIME] datetime2(7)  NULL,
  [EDITOR] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
  [EDIT_TIME] datetime2(7)  NULL,
  [DEL_FLAG] decimal(6)  NULL
)
GO

ALTER TABLE [dbo].[BAC_FLOW_DEF_RESULT] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'主键',
'SCHEMA', N'dbo',
'TABLE', N'BAC_FLOW_DEF_RESULT',
'COLUMN', N'ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'BAC_FLOW_DEF_RESULT',
'COLUMN', N'DEF_NO'
GO

EXEC sp_addextendedproperty
'MS_Description', N'名称',
'SCHEMA', N'dbo',
'TABLE', N'BAC_FLOW_DEF_RESULT',
'COLUMN', N'DEF_NA'
GO

EXEC sp_addextendedproperty
'MS_Description', N'输入码',
'SCHEMA', N'dbo',
'TABLE', N'BAC_FLOW_DEF_RESULT',
'COLUMN', N'INPUT_CODE'
GO

EXEC sp_addextendedproperty
'MS_Description', N'方案编号',
'SCHEMA', N'dbo',
'TABLE', N'BAC_FLOW_DEF_RESULT',
'COLUMN', N'FLOW_NO'
GO

EXEC sp_addextendedproperty
'MS_Description', N'排序码',
'SCHEMA', N'dbo',
'TABLE', N'BAC_FLOW_DEF_RESULT',
'COLUMN', N'SEQ'
GO

EXEC sp_addextendedproperty
'MS_Description', N'组织机构ID',
'SCHEMA', N'dbo',
'TABLE', N'BAC_FLOW_DEF_RESULT',
'COLUMN', N'ORG_ID'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建人',
'SCHEMA', N'dbo',
'TABLE', N'BAC_FLOW_DEF_RESULT',
'COLUMN', N'CREATOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'创建时间',
'SCHEMA', N'dbo',
'TABLE', N'BAC_FLOW_DEF_RESULT',
'COLUMN', N'CREATE_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编辑人',
'SCHEMA', N'dbo',
'TABLE', N'BAC_FLOW_DEF_RESULT',
'COLUMN', N'EDITOR'
GO

EXEC sp_addextendedproperty
'MS_Description', N'编辑时间',
'SCHEMA', N'dbo',
'TABLE', N'BAC_FLOW_DEF_RESULT',
'COLUMN', N'EDIT_TIME'
GO

EXEC sp_addextendedproperty
'MS_Description', N'删除标志',
'SCHEMA', N'dbo',
'TABLE', N'BAC_FLOW_DEF_RESULT',
'COLUMN', N'DEL_FLAG'
GO

EXEC sp_addextendedproperty
'MS_Description', N'方案默认阴性结果结果选项',
'SCHEMA', N'dbo',
'TABLE', N'BAC_FLOW_DEF_RESULT'
GO


-- ----------------------------
-- Primary Key structure for table BAC_FLOW_DEF_RESULT
-- ----------------------------
ALTER TABLE [dbo].[BAC_FLOW_DEF_RESULT] ADD CONSTRAINT [PK__BAC_FLOW__3214EC27163D69F7] PRIMARY KEY CLUSTERED ([ID])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
 */




/**


添加时间   2025-02-13
*添加人     whx
*需求      药敏结果是否同步数据
*需求提出人  项目上线需求

ALTER TABLE [dbo].[BAC_DRUG_RESULT] ADD [IS_SYNC_RESULT] decimal(2)  NULL
GO

EXEC sp_addextendedproperty
'MS_Description', N'是否同步结果',
'SCHEMA', N'dbo',
'TABLE', N'BAC_DRUG_RESULT',
'COLUMN', N'IS_SYNC_RESULT'

 */

/**


添加时间   2025-02-17
*添加人     whx
*需求      药敏结果是否同步数据
*需求提出人  项目上线需求

CREATE TABLE [dbo].[CRI_CRITICAL_REPORT] (
    [ID] nvarchar(36) COLLATE Chinese_PRC_CI_AS DEFAULT NULL NOT NULL,
    [PAT_NO] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [PAT_NA] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [ITEM_NO] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [REPORT_VAL] nvarchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [CURRENT_RESULT] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [DEPT_NO] nvarchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [BED_NO] nvarchar(10) COLLATE Chinese_PRC_CI_AS  NULL,
    [REPORT_TIME] datetime  NULL,
    [IS_REPORT] decimal(2)  NULL,
    [REQUEST_NO] varchar(20) COLLATE Chinese_PRC_CI_AS  NULL,
    [CRITICAL_NO] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [REMARK] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
    [NOTIFICATION_TYPE] nvarchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [CRITICAL_TYPE] decimal(2)  NULL,
    [CULTICAL_ITEM_TYPE] decimal(2)  NULL,
    [CREATOR] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [CREATE_TIME] datetime2(7)  NULL,
    [EDITOR] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [EDIT_TIME] datetime2(7)  NULL,
    [ORG_ID] varchar(36) COLLATE Chinese_PRC_CI_AS  NULL,
    [DEL_FLAG] decimal(2)  NULL,
    [ITEM_NA] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [SYSTEM_NO] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [REPORT_PERSON_NO] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [REPORT_PERSON_NA] varchar(50) COLLATE Chinese_PRC_CI_AS  NULL,
    [REPORT_DEPT_NO] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL,
    [REPORT_DEPT_NA] varchar(100) COLLATE Chinese_PRC_CI_AS  NULL
    )
    GO

ALTER TABLE [dbo].[CRI_CRITICAL_REPORT] SET (LOCK_ESCALATION = TABLE)
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'主键',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'病历号',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'PAT_NO'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'姓名',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'PAT_NA'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'项目代码',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'ITEM_NO'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'报告内容',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'REPORT_VAL'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'危急值结果',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'CURRENT_RESULT'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'科室',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'DEPT_NO'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'床号',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'BED_NO'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'报告时间',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'REPORT_TIME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'是否发布(0否 1是)',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'IS_REPORT'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'申请单号',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'REQUEST_NO'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'危急值的唯一号',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'CRITICAL_NO'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'备注',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'REMARK'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'通知方式',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'NOTIFICATION_TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'危急值类型:1检验 2细菌',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'CRITICAL_TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'危急值项目类型:1血培养 2形态镜像 3敏鉴 4药敏',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'CULTICAL_ITEM_TYPE'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'创建人',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'CREATOR'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'创建时间',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'CREATE_TIME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'编辑人 ',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'EDITOR'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'编辑时间',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'EDIT_TIME'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'组织机构ID',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'ORG_ID'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'删除标志 0 否 1 是',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'DEL_FLAG'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'项目名称',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'ITEM_NA'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'危急值系统名称（哪个系统过来的）',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'SYSTEM_NO'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'上报人',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'REPORT_PERSON_NO'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'上报人姓名',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'REPORT_PERSON_NA'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'上报科室编码',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'REPORT_DEPT_NO'
    GO

    EXEC sp_addextendedproperty
    'MS_Description', N'上报科室名称',
    'SCHEMA', N'dbo',
    'TABLE', N'CRI_CRITICAL_REPORT',
    'COLUMN', N'REPORT_DEPT_NA'
    GO


-- ----------------------------
-- Primary Key structure for table CRI_CRITICAL_REPORT
-- ----------------------------
ALTER TABLE [dbo].[CRI_CRITICAL_REPORT] ADD CONSTRAINT [PK__CRI_CRIT__3214EC27C2EBB54A] PRIMARY KEY CLUSTERED ([ID])
    WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
    ON [PRIMARY]
    GO

 */